// GifShowDlg.cpp : implementation file
//

#include "stdafx.h"
#include "lulutiper.h"
#include "GifShowDlg.h"

#ifdef _DEBUG
#define new DEBUG_NEW
#undef THIS_FILE
static char THIS_FILE[] = __FILE__;
#endif

/////////////////////////////////////////////////////////////////////////////
// CGifShowDlg dialog


CGifShowDlg::CGifShowDlg(CWnd* pParent /*=NULL*/)
	: CDialog(CGifShowDlg::IDD, pParent)
{
	//{{AFX_DATA_INIT(CGifShowDlg)
		// NOTE: the ClassWizard will add member initialization here
	//}}AFX_DATA_INIT
}


void CGifShowDlg::DoDataExchange(CDataExchange* pDX)
{
	CDialog::DoDataExchange(pDX);
	//{{AFX_DATA_MAP(CGifShowDlg)
	DDX_Control(pDX, IDC_GIF, m_gif);
	//}}AFX_DATA_MAP
}


BEGIN_MESSAGE_MAP(CGifShowDlg, CDialog)
	//{{AFX_MSG_MAP(CGifShowDlg)
	//}}AFX_MSG_MAP
END_MESSAGE_MAP()

/////////////////////////////////////////////////////////////////////////////
// CGifShowDlg message handlers

BOOL CGifShowDlg::OnInitDialog() 
{
	CDialog::OnInitDialog();
	
	// TODO: Add extra initialization here

	COleDateTime tm = COleDateTime::GetCurrentTime();
	if (tm.GetMonth() == 2 && tm.GetDay() == 14)
	{
		if (m_gif.Load(MAKEINTRESOURCE(IDR_GIF1) , _T("GIF")))
			m_gif.Draw();
		SetWindowPos(NULL,0,0,m_gif.GetSize().cx,m_gif.GetSize().cy, SWP_NOMOVE);
	}	
	else if (tm.GetMonth() == 6 && tm.GetDay() == 1)
	{
		if (m_gif.Load(MAKEINTRESOURCE(IDR_GIF2) , _T("GIF")))
			m_gif.Draw();
		SetWindowPos(NULL,0,0,m_gif.GetSize().cx,m_gif.GetSize().cy, SWP_NOMOVE);
	}
	else if (tm.GetMonth() == 8 && tm.GetDay() == 29)
	{
		if (m_gif.Load(MAKEINTRESOURCE(IDR_GIF3) , _T("GIF")))
			m_gif.Draw();
		SetWindowPos(NULL,0,0,m_gif.GetSize().cx,m_gif.GetSize().cy, SWP_NOMOVE);
	}
	else if (tm.GetMonth() == 4 && tm.GetDay() == 1)
	{
		if (m_gif.Load(MAKEINTRESOURCE(IDR_GIF4) , _T("GIF")))
			m_gif.Draw();
		SetWindowPos(NULL,0,0,m_gif.GetSize().cx,m_gif.GetSize().cy, SWP_NOMOVE);
	}
	else
	CDialog::OnOK();

	return TRUE;  // return TRUE unless you set the focus to a control
	              // EXCEPTION: OCX Property Pages should return FALSE
}

BOOL CGifShowDlg::PreTranslateMessage(MSG* pMsg) 
{
	// TODO: Add your specialized code here and/or call the base class

	return CDialog::PreTranslateMessage(pMsg);
}
